package practice.book

import java.beans.Transient

import com.sun.xml.internal.ws.developer.Serialization

/**
  * Created by lovepocky(lovepocky@foxmail.com) on 2015/11/3.
  */
class ProgrammingInScala {
	/** Programming In Scala(Chinese Version) */
	val isTest_Example_14 = false
	val isTest_Example_15 = false
	val isTest_Example_25 = true
	
	if (isTest_Example_14) {
		/** extra: c14.1 */
		val assertTrue = true
		val assertFalse = false
		assert(assertTrue)
		assert(assertFalse)
		
		/** extra: c14.2 */
		
		
	}
	
	if (isTest_Example_15) {
		/** ex: p172 */
		abstract class Expr
		case class Var(name: String) extends Expr
		case class Number(num: Double) extends Expr
		case class UnOp(operator: String, arg: Expr) extends Expr
		case class BinOp(operator: String, left: Expr, right: Expr) extends Expr
	}
	
	/**
	  * Chapter 25: 注解
	  */
	if (isTest_Example_25) {
		
		@Deprecated def dep() = {}
		
		@volatile var vol = 0
		
		@Serialization class se {}
		
		@Transient class tr {}
		
		@scala.beans.BeanProperty class bean(val crazy: Int) {}
		
		
	}
}
